home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / SDKs / ScreenLight™ 1.0.1 / CodeExamples / ModuleAPI.h < prev    next >
Encoding:
Text File  |  1995-12-26  |  3.4 KB  |  165 lines  |  [TEXT/CWIE]

  1. // ModuleAPI.h
  2.  
  3. //#include <Types.h>
  4. //#include <Files.h>
  5. //#include <Windows.h>
  6. #include <CodeFragments.h>
  7. //#include <MixedMode.h>
  8.  
  9. #pragma once
  10. //****************************************************************************
  11. // ScreenSaver Module API
  12.  
  13. #define SS_API_VERS            0x0012
  14. #define kSysCustIconID        (-16455)
  15.  
  16. #include "ModuleProcInfos.h"
  17.                                                 // MODULE PROC RECORD
  18. #ifdef powerc
  19.     #pragma options align=mac68k
  20. #endif
  21.  
  22. struct ModuleProcs {
  23.     ModOpenUPP                openProc;
  24.     ModDrawUPP                drawProc;
  25.     ModCloseUPP                closeProc;
  26.     ModAboutUPP                aboutProc;
  27.     ModChangePrefsUPP        chngPrefsProc;
  28. };
  29. typedef struct ModuleProcs ModuleProcs;
  30.  
  31. #ifdef powerc
  32.     #pragma options align=reset
  33. #endif
  34.  
  35.                                             // Drawing Window Interface
  36. #ifdef powerc
  37.     #pragma options align=mac68k
  38. #endif
  39.  
  40. struct DrawingWindow {
  41.     WindowRecord        wRec;
  42.     GrafPtr                modGraf;
  43.     ModuleProcs            modProcs;
  44.     FSSpec                modSpec;
  45.     short                modResRefNum;
  46.     long                modStorage;    
  47.     Boolean                modInPreview;
  48.     long                modInfo;
  49.     CFragConnectionID    modConnID;    
  50. };
  51. typedef struct DrawingWindow DrawingWindow;
  52. typedef DrawingWindow *DrawingWindowPeek;
  53.  
  54. #ifdef powerc
  55.     #pragma options align=reset
  56. #endif
  57.  
  58.                                             // Module ParamBlk
  59. struct ModuleParamBlk {
  60.     GrafPtr            mGraf;
  61.     ModuleProcs        mProcs;
  62.     FSSpec            mSpec;
  63.     short            mResRefNum;
  64.     long            mStorage;
  65.     Boolean            mInPreview;
  66.     long            mInfo;
  67. };
  68. typedef struct ModuleParamBlk ModuleParamBlk;
  69. typedef ModuleParamBlk *ModuleParamBlkPtr;
  70.  
  71.  
  72.                                             // MODULE ROUTINE PROTOTYPES
  73. OSErr ModOpen( ModuleParamBlkPtr mpPtr);
  74. OSErr ModDraw( ModuleParamBlkPtr mpPtr);
  75. OSErr ModClose( ModuleParamBlkPtr mpPtr);
  76. OSErr ModAbout( ModuleParamBlkPtr mpPtr);
  77. OSErr ModChangePrefs( ModuleParamBlkPtr mpPtr);
  78.  
  79.  
  80.  
  81.                                         // Module Controls
  82.                                             // Module Controls
  83. enum {
  84.     kSliderCntl            = 'cSLD',
  85.     kButtonCntl            = 'cBTN',
  86.     kCheckBoxCntl        = 'cCHK',
  87.     kListCntl            = 'cLST',
  88.     kStaticStrCntl        = 'cSTR'
  89. };
  90.  
  91. #define hjPopup            1101            // Jim's CDEF PopupControl
  92. #define hSlider            1105            // Jim's CDEF Horiz Slider
  93. #define ctl3D            0x0002            // 3D control appearance
  94. #define useWFont        0x0008            // draw control with window font
  95.  
  96. #ifdef powerc
  97.     #pragma options align=mac68k
  98. #endif
  99.  
  100. //------
  101. struct Sc_StubRec {
  102.     long    ID;
  103.     long    ctlType;
  104. };
  105. typedef struct Sc_StubRec Sc_StubRec;
  106. //------
  107. struct ScCHK_CheckBoxRec {
  108.     long    ID;
  109.     long    ctlType;
  110.     long    val;
  111.     Str255    titleStr;
  112. };
  113. typedef struct ScCHK_CheckBoxRec ScCHK_CheckBoxRec;
  114. //------
  115.  
  116. struct ScSLD_SliderRec {
  117.     long    ID;
  118.     long    ctlType;
  119.     long    min;        // vers1 -> always 0
  120.     long    max;        // vers1 -> always 100
  121.     long    curValue;
  122.     Str255    titleStr;
  123. };
  124. typedef struct ScSLD_SliderRec ScSLD_SliderRec;
  125. //------
  126.  
  127. struct ScLST_ListRec {
  128.     long    ID;
  129.     long    ctlType;
  130.     long    valueOptions;    // popupMenu value options per IM-VI
  131.     long    menuID;
  132.     long    curValue;
  133.     long    menuH;
  134.     Str255    titleStr;
  135. };
  136. typedef struct ScLST_ListRec ScLST_ListRec;
  137. //------
  138.  
  139. struct ScBTN_ButtonRec {
  140.     long    ID;
  141.     long    ctlType;
  142.     long    isHit;
  143.     Str255    titleStr;
  144. };
  145. typedef struct ScBTN_ButtonRec ScBTN_ButtonRec;
  146. //------
  147.  
  148. #ifdef powerc
  149.     #pragma options align=reset
  150. #endif
  151.  
  152. //--------------------------------------------------------------------------
  153.                                                         // Misc Error Codes
  154. #define kUnknownCtlType        2000
  155. #define kModDisableControl    2002
  156. #define kNoMoreControlSpace 2031
  157.  
  158. #define kNoPreviewMode        1200
  159. #define kNoFPUerr            90
  160. #define kNoCQDerr            92
  161.  
  162.  
  163. //**********************************************************************************
  164. //                                                        E N D   O F   L I S T I N G
  165.